package com.dibang.app.ui;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import android.view.View;
import android.widget.TextView;

import com.amap.api.maps.TextureMapView;
import com.dibang.app.R;
import com.dibang.app.mvp.base.BaseActivity;
import com.dibang.app.mvp.util.ViewUtil;
import com.dibang.app.operation.control.abs.GroupMessageControl;
import com.dibang.app.operation.control.impl.GroupMessageControlImpl;

import butterknife.BindView;
import butterknife.ButterKnife;

public class GroupMessageActivity extends BaseActivity<GroupMessageControl, GroupMessageControlImpl> {

    @BindView(R.id.activity_title_id)
    TextView titleView;

    @BindView(R.id.activity_menu_id)
    TextView menuView;

    @BindView(R.id.group_message_map_view)
    TextureMapView mapView;

    @Override
    protected int onCreateBindViewLayoutId(@Nullable Bundle savedInstanceState) {
        return R.layout.activity_group_message_layout;
    }

    @Override
    protected View onCreateBindViewUpdate(int layoutId, @Nullable Bundle savedInstanceState) {
        return ViewUtil.generateActivityViewContainerTitleView(this,layoutId,R.color.translucent_color);
    }

    @Override
    protected void onCreateBindViewChanged(@Nullable Bundle savedInstanceState) {
        ButterKnife.bind(this);
        mapView.onCreate(savedInstanceState);
        titleView.setText("我的拼团");
        menuView.setText("安全须知");
        menuView.setTextColor(ContextCompat.getColor(this,R.color.blue_gradient_end_color));
    }

    @Override
    public void onSaveInstanceState(Bundle outState) {
        mapView.onSaveInstanceState(outState);
        super.onSaveInstanceState(outState);
    }

    @Override
    protected void onResume() {
        super.onResume();
        mapView.onResume();
    }

    @Override
    protected void onPause() {
        super.onPause();
        mapView.onPause();
    }

    @Override
    protected void onDestroy() {
        super.onDestroy();
        mapView.onDestroy();
    }

    @Override
    public void onLowMemory() {
        super.onLowMemory();
        mapView.onLowMemory();
    }
}
